package com.example.run.teacherhelper.Adapters;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * Created by run on 2015/10/17.
 */
public class FragmentAdapter extends FragmentStatePagerAdapter {
    private List<Fragment> fragmentList;
    private List<String> msgSorts;
    public FragmentAdapter(FragmentManager fm, List<Fragment> fragmentList, List<String> msgSorts) {
        super(fm);
        this.fragmentList=fragmentList;
        this.msgSorts=msgSorts;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return msgSorts.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return msgSorts.get(position);
    }
}
